/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package common.DAO.Factory;

import common.DAO.CategoryDAO;
import common.DAO.ComponentDAO;
import common.DAO.ProductDAO;

/**
 * Abstract class of the DAOFactory.
 * Holds all of the abstract classes for the DAO
 * @author Richard Irons
 */

public abstract class DAOFactory {
    private static DAOFactory factory;

    /**
     * Protected to stop instantiation of this class
     */
    protected DAOFactory(){
    // Exists only to defeat instantiation.
    }
    /**
     * Set the factory to the given factory
     * @param factory
     * factory to be set to
     */
    public static void setFactory(DAOFactory factory){
        DAOFactory.factory = factory;
    }
    /**
     * Get the currnet DAOFactory
     * @return
     * DAOFactory
     */
    public static DAOFactory getDAOFactory(){
        return factory;
    }
    /**
     * Abstract function to get the CategoryDAO, implementation for sub classes
     * @return
     * A CategoryDAO
     */
    public abstract CategoryDAO getCategoryDAO();
    /**
     * Abstract function to get the ComponentDAO, implementation for sub classes
     * @return
     * A ComponentDAO
     */
    public abstract ComponentDAO getComponentDAO();

    public abstract ProductDAO getProductDAO();
 }

